import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

let router = [{
        path: '/',
        component: () => import('@/Home'),
        meta: {
            name: '首页'
        },
        children: [{
                path: '/Home',
                meta: {
                    name: '首页'
                },
                component: () => import('@/views/index')
            }, {
                path: '/customer',
                name: '客户',
                meta: {
                    name: '客户'
                },
                authority: 'customer',
                component: resolve => require(['@/views/customer/index'], resolve),

            }, {
                path: '/resume',
                component: () => import('@/views/resume/index'),
                authority: 'resume:resumeList',
                meta: {
                    name: '人才'
                }
            },
             {
                path: '/upResume',
                component: () => import('@/views/resume/upResume'),
                authority: 'resume:resumeList',
                meta: {
                    name: '上传人才'
                },
                },
            {
                path:'/resume/importRecord',
                authority: 'resume:resumeRecode',
                component: ()=>import('@/views/resume/record'),
                meta:{
                    name:'导入记录'
                }
            },
            {
                path:'/resume/pending',
                authority: 'resume:resumeRecode',
                component: ()=>import('@/views/resume/pending'),
                meta:{
                    name:'待处理人才'
                }
            },
            {
                path: '/Pipeline',
                component: () => import('@/views/Pipeline/index'),
                authority: 'Pipeline',
                meta: {
                    name: 'Pipeline'
                },
            },
            {
                path: '/project',
                component: () => import('@/views/project/index'),
                authority: 'progream',
                meta: {
                    name: '项目'
                },
            },
            {
                path: '/message/finance',
                component: () => import('@/views/message/finance'),
                authority: '',
                meta: {
                    name: '财务消息/项目消息/期报/合同消息'
                },
                name: '财务消息/项目消息/期报/合同消息'
            },
            {
                path: '/message/checkRoco',
                component: () => import('@/views/message/checkRoco'),
                authority: '',
                meta: {
                    name: '查看期报'
                },
                name: '查看期报'
            },
            {
                path: '/setting',
                component: () => import('@/views/setting/index'),
                meta: {
                    name: '系统配置'
                },
            },
            {
                path: '/setting/roles',
                component: () => import('@/views/setting/roles'),
                authority: 'setting:role',
                meta: {
                    name: '设置-角色管理'
                },
            }, {
                path: '/setting/addressbook',
                component: () => import('@/views/setting/addressbook'),
                authority: 'setting:user',
                meta: {
                    name: '设置-通讯录'
                },
            }, {
                path: '/setting/wordtemp',
                component: () => import('@/views/setting/wordtemp'),
                authority: 'setting:wordtemp',
                meta: {
                    name: '设置-模板文件'
                },
            }, {
                path: '/setting/defaultkpi',
                component: () => import('@/views/setting/defaultkpi'),
                authority: 'setting:defaultkpi',
                meta: {
                    name: '设置-默认业绩分配方案'
                },
            }, {
                path: '/setting/specialCom',
                component: () => import('@/views/setting/specialCom'),
                authority: 'setting:specialCom',
                meta: {
                    name: '设置-特殊公司'
                },
            }, {
                path: '/setting/marktemp',
                component: () => import('@/views/setting/marktemp'),
                authority: 'setting:marktemp',
                meta: {
                    name: '设置-备注配置'
                },
            }, {
                path: '/setting/marktemp/config',
                component: () => import('@/components/markTemp/Configremarks'),
                authority: 'setting:marktemp',
                meta: {
                    name: '设置-配置备注'
                },
            }, {
                path: '/setting/marktemp/details',
                component: () => import('@/components/markTemp/Checkmarks'),
                authority: 'setting:marktemp',
                meta: {
                    name: '设置-查看配置'
                },
            }, {
                path: '/setting/signcompany',
                component: () => import('@/views/setting/signcompany'),
                authority: 'setting:signcompany',
                meta: {
                    name: '设置-签约公司配置'
                },
            }, {
                path: '/setting/workflow',
                component: () => import('@/views/setting/workflow'),
                authority: 'setting:workflow',
                meta: {
                    name: '设置-审批流配置'
                },
            }, {
                path: '/setting/resumeConfig',
                component: () => import('@/views/setting/resumeConfig'),
                authority: 'setting:resumeconfig',
                meta: {
                    name: '设置-人才字段匹配'
                },
            }, {
                path: '/setting/markmanage',
                component: () => import('@/views/setting/markmanage'),
                authority: 'setting:markmanage',
                meta: {
                    name: '设置-标签管理'
                },
            }, {
                path: '/setting/customfield',
                component: () => import('@/views/setting/customfield'),
                authority: 'setting:customfield',
                meta: {
                    name: '设置-自定义字段'
                },
            },
            {
                path: '/menuPre',
                component: () => import('@/views/setting/menuPre'),
                authority: '',
                meta: {
                    name: '设置-菜单权限配置'
                },
            },
            {
                path: '/account',
                component: () => import('@/views/setting/account'),
                authority: '',
                name: '账户设置',
                meta: {
                    name: '设置-账户设置'
                },
            },
            {
                path: '/calendar',
                component: () => import('@/views/calendar/index'),
                authority: '',
                meta: {
                    name: '日程'
                },
            },
            {
                path: '/contracts',
                component: () => import('@/views/contracts/index'),
                authority: '',
                meta: {
                    name: '合同管理'
                },
            },
            {
                path: '/contractApproval',
                component: () => import('@/views/contracts/contractApproval'),
                authority: '',
                meta: {
                    name: '合同审批'
                },
            },
            {
                path: '/setting/quartzJob',
                component: () => import('@/views/setting/quartzJob'),
                authority: '',
                name: '定时任务',
                meta: {
                    name: '设置-定时任务'
                },
            },
        ]
    },
    {
        path: '/login',
        name: '',
        component: () => import('@/views/Login'),
    },
    {
        path: '/404',
        component: () => import('@/views/errorPage/404'),
        name: '',
        hidden: true
    },
    {
        path: '/403',
        meta: {
            title: '403-权限不足'
        },
        name: 'error-403',
        component: () => import('@/views/errorPage/403.vue')
    },
    // {
    //     path: '/500',
    //     meta: {
    //         title: '500-服务端错误'
    //     },
    //     name: 'error-500',
    //     component: () => import('@/views/errorPage/500.vue')
    // },
]

export default router
